<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <!--
                        Charisma v1.0.0
        
                        Copyright 2012 Muhammad Usman
                        Licensed under the Apache License v2.0
                        http://www.apache.org/licenses/LICENSE-2.0
        
                        http://usman.it
                        http://twitter.com/halalit_usman
        -->
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Administrador</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <meta name="description"
                  content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">
                <meta name="author" content="Muhammad Usman"><!-- The styles -->
                    <link id="bs-css" href="css/bootstrap-cerulean.css" rel="stylesheet">
                        <style type="text/css">
                            body {
                                padding-bottom: 40px;
                            }

                            .sidebar-nav {
                                padding: 9px 0;
                            }
                        </style>
                        <link href="css/bootstrap-responsive.css" rel="stylesheet"/>
                        <link href="css/charisma-app.css" rel="stylesheet"/>
                        <link href="css/jquery-ui-1.8.21.custom.css" rel="stylesheet"/>
                        <link href='css/fullcalendar.css' rel='stylesheet'/>
                        <link href='css/fullcalendar.print.css' rel='stylesheet' media='print'/>
                        <link href='css/chosen.css' rel='stylesheet'/>
                        <link href='css/uniform.default.css' rel='stylesheet'/>
                        <link href='css/colorbox.css' rel='stylesheet'/>
                        <link href='css/jquery.cleditor.css' rel='stylesheet'/>
                        <link href='css/jquery.noty.css' rel='stylesheet'/>
                        <link href='css/noty_theme_default.css' rel='stylesheet'/>
                        <link href='css/elfinder.min.css' rel='stylesheet'/>
                        <link href='css/elfinder.theme.css' rel='stylesheet'/>
                        <link href='css/jquery.iphone.toggle.css' rel='stylesheet'/>
                        <link href='css/opa-icons.css' rel='stylesheet'/>
                        <link href='css/uploadify.css' rel='stylesheet'/><!-- JqGrig -->
                        <link rel="stylesheet" type="text/css" media="screen"
                              href="jqGrid/css/ui.jqgrid.css" />
                        <!------------> <!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
                        <!--[if lt IE 9]>
                                  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
                                <![endif]--> <!-- The fav icon -->
                        <link rel="shortcut icon" href="img/favicon.ico">
                            </head>

                            <body>
                                <!-- topbar starts -->
                                <div class="navbar">
                                    <div class="navbar-inner">
                                        <div class="container-fluid"><a class="btn btn-navbar"
                                                                        data-toggle="collapse"
                                                                        data-target=".top-nav.nav-collapse,.sidebar-nav.nav-collapse"> <span
                                                    class="icon-bar"></span> <span class="icon-bar"></span> <span
                                                    class="icon-bar"></span> </a> <a class="brand" href="admin.html"><span>Administrador</span></a>

                                            <!-- theme selector starts -->
                                            <div class="btn-group pull-right theme-container"><a
                                                    class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <i
                                                        class="icon-tint"></i><span class="hidden-phone"> Alterar Cor</span> <span
                                                        class="caret"></span> </a>
                                                <ul class="dropdown-menu" id="themes">
                                                    <li><a data-value="classic" href="#"><i class="icon-blank"></i>
                                                            Padrão</a></li>
                                                    <li><a data-value="cerulean" href="#"><i class="icon-blank"></i>
                                                            Azul Claro</a></li>
                                                    <li><a data-value="cyborg" href="#"><i class="icon-blank"></i>
                                                            Preto</a></li>
                                                    <li><a data-value="redy" href="#"><i class="icon-blank"></i>
                                                            Vermelho</a></li>
                                                    <li><a data-value="journal" href="#"><i class="icon-blank"></i>
                                                            Branco</a></li>
                                                    <li><a data-value="simplex" href="#"><i class="icon-blank"></i>
                                                            Simples</a></li>
                                                    <li><a data-value="slate" href="#"><i class="icon-blank"></i>
                                                            Cinza Escuro</a></li>
                                                    <li><a data-value="united" href="#"><i class="icon-blank"></i>
                                                            Laranja</a></li>
                                                </ul>
                                            </div>
                                            <!-- theme selector ends --> <!-- user dropdown starts -->
                                            <div class="btn-group pull-right"><a class="btn dropdown-toggle"
                                                                                 data-toggle="dropdown" href="#"> <i class="icon-user"></i><span
                                                        class="hidden-phone"> Conta</span> <span class="caret"></span> </a>
                                                <ul class="dropdown-menu">
                                                    <li><a href="index.html">Sair</a></li>
                                                </ul>
                                            </div>
                                            <!-- user dropdown ends --></div>
                                    </div>
                                </div>
                                <!-- topbar ends -->
                                <div class="container-fluid">
                                    <div class="row-fluid"><!-- left menu starts -->
                                        <div class="span2 main-menu-span">
                                            <div class="well nav-collapse sidebar-nav">
                                                <ul class="nav nav-tabs nav-stacked main-menu">
                                                    <li class="nav-header hidden-tablet">Menu Principal</li>
                                                    <li><a class="ajax-link" href="adminEscritorio.html"><i class="icon-home"></i><span class="hidden-tablet"> Escrit&oacute;rios</span></a></li>
                                                    <li><a class="ajax-link" href="adminGerente.html"><i class="icon-user"></i><span class="hidden-tablet"> Gerentes</span></a></li>
                                                    <li><a class="ajax-link" href="adminAdvogado.html"><i class="icon-user"></i><span class="hidden-tablet"> Advogados</span></a></li>
                                                    <li><a class="ajax-link" href="adminSecretario.html"><i class="icon-user"></i><span class="hidden-tablet"> SecretÃ¡rias</span></a></li>
                                                    <li><a class="ajax-link" href="adminEstagiario.html"><i class="icon-user"></i><span class="hidden-tablet"> EstagiÃ¡rios</span></a></li>
                                                    <li><a class="ajax-link" href="adminProcesso.html"><i class="icon-list-alt"></i><span class="hidden-tablet"> Processos</span></a></li>
                                                    <li><a class="ajax-link" href="adminCliente.html"><i class="icon-user"></i><span class="hidden-tablet"> Clientes</span></a></li>
                                                    <li><a class="ajax-link" href="../index.php?SGBD/fazerBackup"><i class="icon-wrench"></i><span class="hidden-tablet"> SGBD</span></a></li>
                                                </ul>
                                            </div>
                                            <!--/.well --></div>
                                        <!--/span--> <!-- left menu ends -->

                                        <div id="content" class="span10"><!-- content starts -->
                                            <div class="sortable row-fluid">
                                                <a data-rel="tooltip"
                                                   title="novas pendencias de cadastro de gerente"
                                                   class="well span3 top-block" href="#"> <span
                                                        class="icon32 icon-red icon-user"></span>
                                                    <div>HÃ¡ novos gerentes solicitando cadastro</div> <span
                                                        id="notication-gerente" class="notification"></span>
                                                </a> <a data-rel="tooltip" title="usu&aacute;rios cadastrados"
                                                        class="well span3 top-block" href="#"> <span
                                                        class="icon32 icon-color icon-star-on"></span>
                                                    <div>Membros Cadastrados</div> <span class="notification green"
                                                                                         id="notication-total-membros"></span>
                                                </a> <a data-rel="tooltip"
                                                        title="escrit&oacute;rios utilizando o sistema"
                                                        class="well span3 top-block" href="#"> <span
                                                        class="icon32 icon-color icon-home"></span>
                                                    <div>Escrit&oacute;rios</div>
                                                    <span class="notification yellow" id="notication-total-escritorios"></span>
                                                </a> <a data-rel="tooltip" title="Processos cadastrados"
                                                        class="well span3 top-block" href="#"> <span
                                                        class="icon32 icon-color icon-book"></span>
                                                    <div>Processos Cadastrados</div>
                                                    <span class="notification red" id="notication-total-processos"></span>
                                                </a>
                                            </div>
                                            <div class="row-fluid sortable">
                                                <div class="box span12">
                                                    <div class="box-header well" data-original-title>
                                                        <h2><i class="icon-user"></i>Eventos</h2>
                                                        <div class="box-icon"><a href="#"
                                                                                 class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
                                                        </div>
                                                    </div>
                                                    <button type="button" class="btn btn-info btn-setting"
                                                            style="width: 10%">Cadastrar evento</button>
                                                    <div id="div_tb_clientes" class="box-content">
                                                        <table id="tb_clientes"></table>
                                                        <div id="pager_tb_clientes"></div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <hr><!-- Caixas de confirmação para deleção -->
                                        <div class="modal hide fade" id="confirm-delete"
                                             style="width: 256px; left: 60%;">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal">×</button>
                                                <h3>Exclusão de Evento</h3>
                                            </div>
                                            <div class="modal-body">
                                                <p>Deseja excluir este evento?</p>
                                            </div>
                                            <div class="modal-footer"><a href="#" class="btn btn-success"
                                                                         data-dismiss="modal"> <i class="icon icon-white icon-close"></i>
                                                    Não </a> <a href="#" class="btn btn-danger" data-dismiss="modal"
                                                            onclick='deleteEvento(deleteEventoID)'> <i
                                                        class="icon icon-white icon-trash"></i> Sim </a></div>
                                        </div>

                                        <div class="modal hide fade" id="confirm-block"
                                             style="width: 256px; left: 60%;">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal">×</button>
                                                <h3>Bloqueio de evento</h3>
                                            </div>
                                            <div class="modal-body">
                                                <p>Deseja bloquear este evento?</p>
                                            </div>
                                            <div class="modal-footer"><a href="#" class="btn btn-success"
                                                                         data-dismiss="modal"> <i class="icon icon-white icon-close"></i>
                                                    Não </a> <a href="#" class="btn btn-danger" data-dismiss="modal"> <i
                                                        class="icon-lock icon-white"></i> Sim </a></div>
                                        </div>
                                        <!-- Fim das caixas --> <footer>
                                            <p class="pull-left">&copy; <a href="#" target="_blank">Bacharel
                                                    6º Ciclo FATEC Carapicuíba</a> 2012</p>
                                        </footer>
                                </div>
                                <!--/.fluid-container-->
                                <!-- Formulário de edição de usuário
                                                        Melhora: Passar página para .php e usar include evitando repetir este código em todas as páginas
                                -->
                                <!-- Cadastrar -->
                                <div class="modal hide fade" id="myModal">
                                    <div class="modal-body" style="min-height: 0px">
                                        <div class="row-fluid sortable">
                                            <div class="box-content">
                                                <form class="form-horizontal" name="formCadastro" method="post">
                                                    <fieldset>
                                                        <div class="control-group"><label class="control-label"
                                                                                          for="nomeEventoCadastro">Nome</label>
                                                            <div class="controls"><input class="input-xlarge focused"
                                                                                         id="nomeEventoCadastro" maxlength="50" type="text"></div>
                                                        </div>
                                                        <div class="control-group"><label class="control-label"
                                                                                          for="dataInicioEventoCadastro">Data inicio</label>
                                                            <div class="controls"><input class="input-xlarge focused"
                                                                                         id="dataInicioEventoCadastro" maxlength="50" type="text"></div>
                                                        </div>
                                                        <div class="control-group"><label class="control-label"
                                                                                          for="dataProximoEventoCadastro">Data proximo</label>
                                                            <div class="controls"><input class="input-xlarge focused"
                                                                                         id="dataProximoEventoCadastro" maxlength="50" type="text"></div>
                                                        </div>
                                                        <div class="control-group"><label class="control-label"
                                                                                          for="arquivo">Arquivo</label>
                                                            <div class="controls"><input name="arquivo" type="file"
                                                                                         id="arquivoCad" /></div>
                                                        </div>
                                                    </fieldset>
                                                </form>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="modal-footer"><a href="#" class="btn"
                                                                 data-dismiss="modal" onclick="redirect()">Fechar</a> <a href="#"
                                                                 class="btn btn-primary" onclick="return submitCadastroEvento()">Cadastrar</a>
                                    </div>
                                </div>
                                <!-- Editar Evento -->
                                <div class="modal hide fade" id="edit_cliente">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal">×</button>
                                        <h3>Editar evento</h3>
                                    </div>
                                    <div class="modal-body" style="min-height: 0px">
                                        <div class="row-fluid sortable">
                                            <div class="box-content">
                                                <form class="form-horizontal" name="formUpdate">
                                                    <fieldset>
                                                        <div class="control-group"><label class="control-label"
                                                                                          for="nomeEvento">Nome </label>
                                                            <div class="controls"><input class="input-xlarge focused"
                                                                                         id="nomeEvento" maxlength="50" type="text" value="X"
                                                                                         onBlur="trim(formUpdate.nomeEvento)"></div>
                                                        </div>
                                                        <div class="control-group"><label class="control-label"
                                                                                          for="dataInicioEvento">Data inicio</label>
                                                            <div class="controls"><input class="input-xlarge focused"
                                                                                         id="dataInicioEvento" onBlur="trim(formUpdate.dataInicioEvento)"
                                                                                         maxlength="80" type="text"></div>
                                                        </div>
                                                        <div class="control-group"><label class="control-label"
                                                                                          for="dataProximoEvento">Data a proximo </label>
                                                            <div class="controls"><input class="input-xlarge focused"
                                                                                         id="dataProximoEvento" onBlur="trim(formUpdate.dataProximoEvento)"
                                                                                         maxlength="35" type="text"></div>
                                                        </div>
                                                        <!-- Campo de upload -->
                                                        <div class="control-group"><label class="control-label"
                                                                                          for="arquivo">Arquivo </label>
                                                            <div class="controls"><input name="arquivo" type="file"
                                                                                         id="arquivo" /></div>
                                                        </div>
                                                    </fieldset>
                                                </form>
                                            </div>
                                        </div>
                                        <!--/row--></div>
                                    <div class="modal-footer"><a href="#" class="btn"
                                                                 data-dismiss="modal">Cancelar</a> <a href="#" class="btn btn-primary"
                                                                 data-dismiss="modal" onclick="updateEvento(updateEventoId)">Atualizar</a>
                                    </div>
                                </div>
                                <!-- Formulário de edição de usuário -->

                                <!-- external javascript
                                        ================================================== -->
                                <!-- Placed at the end of the document so the pages load faster -->

                                <!-- jQuery -->
                                <script src="js/jquery-1.7.2.min.js"></script>
                                <!-- jQuery UI -->
                                <script src="js/jquery-ui-1.8.21.custom.min.js"></script>
                                <!-- transition / effect library -->
                                <script src="js/bootstrap-transition.js"></script>
                                <!-- alert enhancer library -->
                                <script src="js/bootstrap-alert.js"></script>
                                <!-- modal / dialog library -->
                                <script src="js/bootstrap-modal.js"></script>
                                <!-- custom dropdown library -->
                                <script src="js/bootstrap-dropdown.js"></script>
                                <!-- scrolspy library -->
                                <script src="js/bootstrap-scrollspy.js"></script>
                                <!-- library for creating tabs -->
                                <script src="js/bootstrap-tab.js"></script>
                                <!-- library for advanced tooltip -->
                                <script src="js/bootstrap-tooltip.js"></script>
                                <!-- popover effect library -->
                                <script src="js/bootstrap-popover.js"></script>
                                <!-- button enhancer library -->
                                <script src="js/bootstrap-button.js"></script>
                                <!-- accordion library (optional, not used in demo) -->
                                <script src="js/bootstrap-collapse.js"></script>
                                <!-- carousel slideshow library (optional, not used in demo) -->
                                <script src="js/bootstrap-carousel.js"></script>
                                <!-- autocomplete library -->
                                <script src="js/bootstrap-typeahead.js"></script>
                                <!-- tour library -->
                                <script src="js/bootstrap-tour.js"></script>
                                <!-- library for cookie management -->
                                <script src="js/jquery.cookie.js"></script>
                                <!-- calander plugin -->
                                <script src='js/fullcalendar.js'></script>
                                <!-- data table plugin -->
                                <script src='js/jquery.dataTables.min.js'></script>

                                <!-- chart libraries start -->
                                <script src="js/excanvas.js"></script>
                                <script src="js/jquery.flot.min.js"></script>
                                <script src="js/jquery.flot.pie.min.js"></script>
                                <script src="js/jquery.flot.stack.js"></script>
                                <script src="js/jquery.flot.resize.min.js"></script>
                                <!-- chart libraries end -->

                                <!-- select or dropdown enhancer -->
                                <script src="js/jquery.chosen.min.js"></script>
                                <!-- checkbox, radio, and file input styler -->
                                <script src="js/jquery.uniform.min.js"></script>
                                <!-- plugin for gallery image view -->
                                <script src="js/jquery.colorbox.min.js"></script>
                                <!-- rich text editor library -->
                                <script src="js/jquery.cleditor.min.js"></script>
                                <!-- notification plugin -->
                                <script src="js/jquery.noty.js"></script>
                                <!-- file manager library -->
                                <script src="js/jquery.elfinder.min.js"></script>
                                <!-- star rating plugin -->
                                <script src="js/jquery.raty.min.js"></script>
                                <!-- for iOS style toggle switch -->
                                <script src="js/jquery.iphone.toggle.js"></script>
                                <!-- autogrowing textarea plugin -->
                                <script src="js/jquery.autogrow-textarea.js"></script>
                                <!-- multiple file upload plugin -->
                                <script src="js/jquery.uploadify-3.1.min.js"></script>
                                <!-- history.js for cross-browser state change on ajax -->
                                <script src="js/jquery.history.js"></script>
                                <!-- application script for Charisma demo -->
                                <script src="js/charisma.js"></script>
                                <script src="js/jquery.validaCampos.js"></script>
                                <!-- jqGrid -->
                                <script src="jqGrid/js/i18n/grid.locale-pt-br.js" type="text/javascript"></script>
                                <script src="jqGrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
                                <script src="js/jquery.ui.datepicker-pt-BR.js"></script>

                                <script type="text/javascript">		
                                    var prmstr = window.location.search.substr(1);
                                    var prmarr = prmstr.split ("&");
                                    var params = {};

                                    for ( var i = 0; i < prmarr.length; i++) {
                                        var tmparr = prmarr[i].split("=");
                                        params[tmparr[0]] = tmparr[1];
                                    }
                                    // Url usada para deletar os processos
                                    var deleteURL = "../index.php?evento/removerEvento";
                                    // Url usada para atualizar dados do evento
                                    var updateURL = "../index.php?evento/atualizarEvento";
                                    // Url usada para adquirir lista de eventos atraves do processo
                                    var listEvento = "../index.php?evento/listAllByProcesso&id_processo=" +params.id_processo;
                                    // Url que traz todos os dados do evento para exibição no form de edição
                                    var getEventoDataURL = "../index.php?evento/getEvento";
				
				
                                    <!-------------------------------------------------------------------->

                                    // Id do evento usado para deleção
                                    var deleteEventoID = -1;
                                    // Id do evento usado para atualização
                                    var updateEventoId = -1;
                                </script>
                                <!-- Tabela jqGrid -->
                                <script type="text/javascript">
                                    $(document).ready(function(){
                                        $("#tb_clientes").jqGrid({
                                            url:listEvento,
                                            datatype:"json",
                                            colNames: ["id", "Processo", "Nome", "Data inicio", "Data proximo","Arquivo","Ações"],
                                            colModel: [
                                                {name:"id", hidden:true, key: true},
                                                {name:"id_processo", resizeable:true, sortable: true, width: 80},
                                                {name:"nome", resizeable:true, sortable: true, width: 100},
                                                {name:"data_inicio", resizeable:true, sortable: true, width: 100},
                                                {name:"data_proximo", resizeable:true, sortable: true,width: 80},
                                                {name:"arquivo", resizeable:true, sortable: true,width: 80},
                                                {name:"acoes", resizeable:false, sortable: false, width:80}
                                            ],
                                            autowidth:true,	
                                            rowNum: 10,
                                            gridComplete: function(){ 
                                                var ids = $("#tb_clientes").getDataIDs(); // Pega os IDs das linhas
                                                for(var i=0;i<ids.length;i++){
                                                    // Pega id do usuário
                                                    // 							alert($("#tb_clientes").jqGrid('getRowData', ids[i]).id);
                                                    // Modifica o campo acoes de todas as linhas inserindo os botões customizados
                                                    $("#tb_clientes").jqGrid('setRowData',ids[i],{acoes:"<!--<a  class='btn btn-success' title='Bloquear' href='#' onclick=''><i class='icon-lock icon-white'></i></a>--><a title='Editar' class='btn btn-info' href='#' onclick=showUpdateForm("+ids[i]+")><i class='icon-edit icon-white'></i></a><a title='Remover' class='btn btn-danger' href='#' onclick=showConfirmDelete("+ids[i]+")><i class='icon-trash icon-white'></i></a>"});
                                                    // Modifica os campos de texto com ativo/inativo
                                                    // 							if(parseInt($("#tb_clientes").jqGrid('getRowData', ids[i]).status) == 1)
                                                    // 								$("#tb_clientes").jqGrid('setRowData', ids[i], {status:"<span class='label label-success'  onclick='inativarStatusProcesso("+ids[i]+")' >Ativo</span>"});
                                                    // 							else
                                                    // 								$("#tb_clientes").jqGrid('setRowData', ids[i], {status:"<span class='label label-warning' onclick='ativarStatusProcesso("+ids[i]+")'>Inativo</span>"});
                                                } 
                                            },
                                            //multiselect: true, // Também podemos tirar os botões de cada linha e utilizar um sistema de multiseleção e usar apenas três botões
                                            pager:$("#pager_tb_clientes")
                                        }).navGrid("#pagerTbClientes", {edit:false, add:false, del:false});
                                    });
                                    $(window).resize(function(){
                                        var width = document.getElementById("div_tb_clientes").offsetWidth;
                                        $("#tb_clientes").setGridWidth(width-20);
                                    });
			
			
                                    function showConfirmDelete(id) {
                                        deleteEventoID = id;
                                        $("#confirm-delete").modal('show');
                                    }
                                    function showUpdateForm(eventoId) {
                                        updateEventoId = eventoId;

                                        jQuery.get(getEventoDataURL, {id_evento:eventoId}, function(ret){
                                            /**
                                                                                ['id_processo'],
                                                                                ['nome'],
                                                                                ['data_inicio'],
                                                                                ['data_proximo'],
                                             */
					
                                            document.getElementById('nomeEvento').value = ret[1];
                                            document.getElementById('dataInicioEvento').value = ret[2];
                                            document.getElementById('dataProximoEvento').value = ret[3];
                                            $("#edit_cliente").modal('show');
                                        },
                                        "json");
                                    }
                                    function updateEvento(eventoId) {
                                        var nome = document.getElementById('nomeEvento');
                                        var dataInicio = document.getElementById('dataInicioEvento');
                                        var dataProximo = document.getElementById('dataProximoEvento');
                                        var file = document.getElementById('arquivo');
							
                                        var urlUpload = "../controllers/upload_update_evento.php";
						
                                        var fd = new FormData(); 
                                        fd.append( 'id_evento', eventoId);   
                                        fd.append( 'arquivo', file.files[0]);
                                        fd.append( 'data_inicio', dataInicio.value);
                                        fd.append( 'nome', nome.value);
                                        fd.append( 'data_proximo', dataProximo.value);	
                                        fd.append( 'id_processo', params.id_processo);								
                                        $.ajax({
                                            url: urlUpload,
                                            data: fd ,
                                            processData: false,
                                            contentType: false,
                                            type: 'POST',
                                            success: function(data){
                                                if (data == "1"){
                                                    redirect();
                                                }
                                            }
                                        });
                                    }

					
			
			
                                    function deleteEvento(eventoId) {
                                        jQuery.get(deleteURL, {id_evento:eventoId+""}, function(ret){}, "html");
                                        $("#tb_clientes").trigger('reloadGrid');
                                    }
                                    function redirect() {
                                        window.location.href = "adminEvento.html?id_processo="+params.id_processo;
                                    }
                                    function submitCadastroEvento() {
                                        isValid = 1;
                                        // 				['nome'],
                                        // 				['data_inicio'],
                                        // 				['data_proximo'],
                                        var nome = document.getElementById('nomeEventoCadastro');
                                        var dataInicio = document.getElementById('dataInicioEventoCadastro');
                                        var dataProximo = document.getElementById('dataProximoEventoCadastro');
                                        var file = document.getElementById('arquivoCad');
				
                                        var urlUpload = "../controllers/upload.php";
			
                                        var fd = new FormData();    
                                        fd.append( 'arquivo', file.files[0]);
                                        fd.append( 'data_inicio', dataInicio.value);
                                        fd.append( 'nome', nome.value);
                                        fd.append( 'data_proximo', dataProximo.value);	
                                        fd.append( 'id_processo', params.id_processo);								
                                        $.ajax({
                                            url: urlUpload,
                                            data: fd ,
                                            processData: false,
                                            contentType: false,
                                            type: 'POST',
                                            success: function(data){
                                                if (data == "1"){
                                                    redirect();
                                                }
                                            }
                                        });
                                    }
                                </script>
                                <script type="text/javascript">
                                    $(function() {
                                        jQuery.get('../index.php?notificacao/totalGerentes', {}, function(ret) {
                                            document.getElementById('notication-gerente').innerHTML = ret;
                                        }, "html");
                                        jQuery.get('../index.php?notificacao/totalMembros',{},function(ret) {
                                            document.getElementById('notication-total-membros').innerHTML = ret;
                                        }, "html");
                                        jQuery.get('../index.php?notificacao/totalEscritorios',{},function(ret) {
                                            document.getElementById('notication-total-escritorios').innerHTML = ret;
                                        }, "html");
                                        jQuery.get('../index.php?notificacao/totalProcessos',{},function(ret) {
                                            document.getElementById('notication-total-processos').innerHTML = ret;
                                        }, "html");
                                    });
                                </script>
                            </body>
                            </html>
